package cn.whb.hrm.feign;

import cn.whb.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserInfoFallback implements FallbackFactory<UserInfoFeignClient>{
    @Override
    public UserInfoFeignClient create(Throwable throwable) {
        return new UserInfoFeignClient() {
            @Override
            public AjaxResult findUserInfo(Long id) {
                return AjaxResult.me().setSuccess(false).setMessage("调用system服务出错了");
            }
        };
    }
}
